﻿@model IEnumerable<PessModel.ExpertJudge>

@{
    ViewBag.Title = "ChooseReviewer";
    PessModel.ExpertGroup eg = (PessModel.ExpertGroup)ViewBag.Group;
}

<h2 style="width:400px;">Group: @eg.Callsign</h2>
<div id="operate">
    @* @Html.ActionLink("Create Reviewer", "CreateInGroup", "ExpertJudge", new { ExpertGroupID = Model.ID, activityID = Model.Subject.ActivityID }, null)&#8195;*@
    @Html.ActionLink("Back", "Details", "ExpertGroup", new { id = eg.ID }, null)
</div>
<fieldset class="show">
    <legend></legend>
    <div class="display-label" style="text-align:left;width:300px;">
        @*@Html.DisplayNameFor(model => model.Callsign)*@Choose Reviewer
    </div>
    <div class="display-field">
        
    </div>
    @if(Model.Count()>0)
    { 
    using (@Html.BeginForm())
    {
        <table class="oddTable">
            <tr>
                <th></th>
                <th>
                    @Html.DisplayNameFor(model => model.SerialNumber)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.RealName)
                </th>
                <th>
                    @*@Html.DisplayNameFor(model => model.ExpertGroupID)*@
                    Groups
                </th>
                @*<th>
                        @Html.DisplayNameFor(model => model.Email)
                    </th>*@
            </tr>
            @{int x = 0;}
            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        @Html.CheckBox("reviewers[" + x + "].IsSelected")
                    @Html.Hidden("reviewers[" + x + "].SerialNumber", item.SerialNumber)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.SerialNumber)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.RealName)
                </td>
                <td>
                    @foreach(var group in item.ExpertGroups)
                    { 
                             @group.Callsign <br/>
                    }
                </td>
                @*<td>
                        @Html.DisplayFor(modelItem => item.Email)
                    </td>*@
            </tr>
                { x = x + 1; }
            }

        </table>
        @Html.Hidden("id", eg.ID)
        <div style="padding-top:20px">    
            <input type="submit" value="Add" class="asBtn" />
        </div>

    }
    }
    else
    {
        <h3>There is no more available reviewers for this group.</h3>
    }
    </fieldset>
